# 我能改参数吗
def hello(name):
    name = 'world'
    print('hello ' + name)


hello('python')


# 关键字参数和默认值
def hello_1(greeting, name):
    print("{}, {}!".format(greeting, name))


hello_1('hello', 'hello_1')


def hello_2(greeting='hello', name='hello_2'):
    print("{}, {}!".format(greeting, name))


hello_2()


def hello_3(greeting='hello', name='hello_3'):
    print("{}, {}!".format(greeting, name))


hello_3(name='world!!!')


# 收集参数
def get_params(*params):
    print(params)


get_params(1, 2, 3, 4, 5)


# 分配参数
def add(x, y):
    return x + y


params = (1, 2)
print(add(*params))


params = {'name': 'Sir Robin', 'greeting': 'Well met'}
hello_3(**params)




